package com.liujun.spring4.demo.aop.iocset.beanConfig.configuration;

import com.liujun.spring4.demo.aop.iocset.beanConfig.configuration.dao.LogDao;
import com.liujun.spring4.demo.aop.iocset.beanConfig.configuration.dao.UserDao;
import com.liujun.spring4.demo.aop.iocset.beanConfig.configuration.service.LogonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ImportResource;

/**
 * 通过importResource引入XML配置文件
 *
 * @author liujun
 * @version 1.0
 * @date 2018-08-22 19:57:00
 */
@Configurable
@ImportResource(
        "classpath:com/liujun/spring4/demo/aop/iocset/beanConfig/configuration/beanConfigurationDef.xml")
public class LogonAppConfig {

  @Bean
  @Autowired
  public LogonService logonService(UserDao userDao, LogDao logDao) {
    LogonService logonService = new LogonService();
    logonService.setLogDao(logDao);
    logonService.setUserDao(userDao);

    return logonService;
  }
}
